import {Component, Input, OnInit} from '@angular/core';
import {TableDetailModel} from './table-detail.model';
import {Router} from '@angular/router';
import {AppService} from '../../app.service';

@Component({
  selector: 'app-table-detail',
  templateUrl: './table-detail.component.html',
  styleUrls: ['./table-detail.component.scss']
})
export class TableDetailComponent implements OnInit {

  @Input() tableDetailModel: TableDetailModel;

  constructor(public router: Router,
              public appService: AppService) {
  }

  ngOnInit() {
  }

  // 返回
  public revert(url) {
    this.router.navigateByUrl(url);
  }

  // 图片处理
  public imgHandle(url, id) {
    if (url) {
      id.setAttribute('src', url);
    }
  }
}
